<?php
declare (strict_types = 1);

namespace app\admin\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class LogisticsOrder extends BaseModel
{
    //
    protected $table = 'db_logistics_order';
    protected $pk = 'id';
    // 设置字段信息
    protected $schema = [
        'id'          => 'int',
        'company_id'       => 'int',
        'logistics_no'      => 'string',
        'logistics_voucher'       => 'string',
        'cost'       => 'string',
        'transaction_currency_id'       => 'int',
        'notes'          => 'string',
        'first_name'      => 'string',
        'last_name'      => 'string',
        'email'      => 'string',
        'phone'      => 'string',
        'address'      => 'string',
        'country_id'      => 'int',
        'city_id'      => 'int',
        'country_name'      => 'string',
        'city_name'      => 'string',
        'state'      => 'string',
        'zip_code'      => 'string',
        'company'      => 'string',
        'address2'      => 'string',
        'state_id'      => 'string',
        'serial_number'      => 'string',
        'ship_date'      => 'date',
        'type'      => 'int',
        'status'      => 'int',
        'create_time' => 'datetime',
        'arrival_date' => 'datetime',
        'real_arrival_date' => 'datetime',
        'update_time' => 'datetime',

    ];

    protected $attributes = [
        'status' => [
            1 => '正常',
            2 => '取消',
            3=>'已入库'
        ]
    ];
    public function items()
    {
        return $this->hasMany(LogisticsOrderItem::class, 'logistics_order_id', 'id');
    }
}
